<template>
  <div class="regularWorkAdd">
    <div class="common_step">
      <div class="title">
        <div class="breadcrumb">
          <div
            class="breadcrumb__item breadcrumb__item--center"
            @click="back()"
          >
            定期工作配置
          </div>
          <div class="breadcrumb__item">/</div>
          <div class="breadcrumb__item breadcrumb__item--center">
            新增定期工作计划
          </div>
        </div>
        <div class="breadcrumbBtn">
          <div class="btn_ative" @click="">
            <img
              class="operation_btn"
              src="../../../assets/images/images_new/save_icon.png"
              alt=""
            />
            <span>保存</span>
          </div>
          <div class="btn_ative" @click="back()">
            <img
              class="operation_btn"
              src="../../../assets/images/images_new/back_icon.png"
              alt=""
            />
            <span>返回</span>
          </div>
        </div>
      </div>
    </div>
    <div class="content">
      <el-form
        ref="ruleFormRef"
        :model="state.ruleForm"
        :rules="rules"
        label-position="right"
        class="demo-ruleForm"
        size="default"
        status-icon
        label-width="120px"
        style="display: block"
      >
        <div class="formItem">
          <el-form-item label="工作内容" prop="brand">
            <el-input
              v-model="state.ruleForm.name"
              autocomplete="off"
              :autosize="{ minRows: 3, maxRows: 3 }"
              type="textarea"
              resize="none"
            />
          </el-form-item>
        </div>
        <div class="formItem">
          <el-form-item label="定期工作描述" prop="brand">
            <el-input
              v-model="state.ruleForm.name"
              :autosize="{ minRows: 2, maxRows: 2 }"
              type="textarea"
              resize="none"
            />
          </el-form-item>
        </div>
        <div class="box">
          <div class="formItem">
            <el-form-item label="所属分组" prop="brand">
              <el-input v-model="state.ruleForm.name" />
            </el-form-item>
          </div>
          <div class="formItem">
            <el-form-item label="定期工作类别" prop="brand">
              <el-input v-model="state.ruleForm.name" />
            </el-form-item>
          </div>
          <div class="formItem">
            <el-form-item label="机组" prop="brand">
              <el-input v-model="state.ruleForm.name" />
            </el-form-item>
          </div>
        </div>
        <div class="formItem">
          <el-form-item label="关联设备" prop="brand">
            <el-input v-model="state.ruleForm.name" />
          </el-form-item>
        </div>
        <div class="formItem">
          <el-form-item label="关联测点" prop="brand">
            <el-input v-model="state.ruleForm.name" />
          </el-form-item>
        </div>
        <div class="box">
          <div class="formItem">
            <el-form-item label="时间" prop="brand">
              <el-input v-model="state.ruleForm.name" />
            </el-form-item>
          </div>
          <div class="formItem">
            <el-form-item label="时限" prop="brand">
              <el-input v-model="state.ruleForm.name" />
            </el-form-item>
          </div>
          <div class="formItem">
            <el-form-item label="班次" prop="brand">
              <el-input v-model="state.ruleForm.name" />
            </el-form-item>
          </div>
        </div>
      </el-form>
    </div>
  </div>
</template>

<script setup lang="ts">
import type { FormInstance, FormRules } from "element-plus";
const router = useRouter();
const state = reactive({
  ruleForm: {
    name: "",
  },
});

const rules = reactive<FormRules>({
  deviceTypeId: [
    { required: true, message: "系统分类需选至最后一级", trigger: "change" },
  ],
});

const back = () => {
  router.go(-1);
};
</script>

<style lang="scss" scoped>
.regularWorkAdd {
  background-color: #e5e5e5;
  height: 100%;
  width: 100%;
  padding: 0 15px;
  display: flex;
  flex-direction: column;
  position: relative;

  .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    height: 85px;
    background: rgb(255, 255, 255);
    border-radius: 0px 0px 8px 8px;
    padding-left: 30px;

    .breadcrumb {
      width: 320px;
      height: 38px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 10px;
      border: 1px solid rgba(0, 0, 0, 0.05);
      font-size: 16px;
      font-weight: 400;

      .breadcrumb__item {
        display: flex;
        align-items: center;

        &:first-child {
          cursor: pointer;
          color: rgb(151, 151, 151);
        }
      }

      .breadcrumb__item--center {
        flex: 1;
        justify-content: center;
      }
    }

    .breadcrumbBtn {
      margin-right: 42.5px;
      display: flex;

      .btn_ative {
        width: auto;
        height: 35px;
        line-height: 35px;
        cursor: pointer;
        display: inline-block;
        margin-right: 18px;
        display: flex;
        align-items: center;
        color: #353535;
        font-size: 14px;
        padding: 0 8px;

        &:last-child {
          margin-right: 0;
        }

        &:hover {
          background: rgba(0, 0, 0, 0.1);
          border-radius: 2px;
        }

        .operation_btn {
          height: 20px;
          margin-right: 7px;
        }
      }
    }
  }

  .content {
    flex: 1;
    overflow: auto;
    height: calc(100vh - 207px);
    background: rgb(255, 255, 255);
    border-radius: 8px;
    padding-top: 28px;

    .formItem {
      margin-bottom: 23px;
      padding-left: 37px;
      //    padding-right: 273px;
      width: 100%;

      :deep(.el-form-item__label) {
        padding-right: 24px;
      }

      :deep(.el-cascader) {
        width: 500px !important;

        .el-input {
          width: 100%;
        }
      }
      :deep(.el-textarea) {
        width: 500px !important;
      }

      .el-input {
        width: 500px;
      }
    }
    .box {
      display: flex;
      .formItem {
        width: auto;
        :deep(.el-cascader) {
          width: 200px !important;

          .el-input {
            width: 100%;
          }
        }
        .el-input {
          width: 200px;
        }
      }
    }
  }
}
</style>
